package net.ak.session;

import java.io.Serializable;
import java.util.Date;

import net.ak.model.User;

@SuppressWarnings("serial")
public class UserTO implements Serializable {
	private User	user;
	private String	session;
	private Date	lastOperation;

	
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result 		= 1;
		result 			= prime * result + ((session == null) ? 0 : session.hashCode());
		return result;
	}

	
	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserTO other = (UserTO) obj;
		if (session == null) {
			if (other.session != null)
				return false;
		} else if (!session.equals(other.session))
			return false;
		return true;
	}

	/**
	 * @return the user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * @param user
	 *            the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	}

	/**
	 * @return the session
	 */
	public String getSession() {
		return session;
	}

	/**
	 * @param session
	 *            the session to set
	 */
	public void setSession(String session) {
		this.session = session;
	}

	/**
	 * @return the lastOperation
	 */
	public Date getLastOperation() {
		return lastOperation;
	}

	/**
	 * @param lastOperation
	 *            the lastOperation to set
	 */
	public void setLastOperation(Date lastOperation) {
		this.lastOperation = lastOperation;
	}

}
